From 5c49f4e2b2903718c13a6ec5777f3a4514ea1611 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 8 Apr 2009 13:18:22 +0100 Subject: [PATCH] network-nat: add domain info for nat-dhcpd Signed-off-by: Wei Kong --- tools/hotplug/Linux/network-nat | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/hotplug/Linux/network-nat b/tools/hotplug/Linux/network-nat index d9c62c6160..aab793d93f 100644 --- a/tools/hotplug/Linux/network-nat +++ b/tools/hotplug/Linux/network-nat @@ -48,12 +48,16 @@ then fi fi +domain_name=`cat /etc/resolv.conf | grep -v "#" | grep -E 'search|domain' -i | tail -n 1 | awk '{ print $2 }'` +nameserver=`cat /etc/resolv.conf | grep -v "#" | grep "nameserver" -i -m 1 | awk '{ print $2 }'` function dhcp_start() { if ! grep -q "subnet 10.0.0.0" "$dhcpd_conf_file" then - echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {}" + echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {\ + option domain-name \"$domain_name\";\ + option domain-name-servers $nameserver; }" fi "$dhcpd_init_file" restart -- 2.30.2